package com.joolun.activity.service.impl;

import java.util.List;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.joolun.activity.domain.ShareInfo;
import com.joolun.activity.mapper.ShareInfoMapper;
import com.joolun.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.joolun.activity.mapper.VoteInfoMapper;
import com.joolun.activity.domain.VoteInfo;
import com.joolun.activity.service.IVoteInfoService;

/**
 * 投票Service业务层处理
 *
 * @author www.joolun.com
 * @date 2023-01-18
 */
@Service
public class VoteInfoServiceImpl extends ServiceImpl<VoteInfoMapper, VoteInfo> implements  IVoteInfoService
{
    @Autowired
    private VoteInfoMapper voteInfoMapper;

    /**
     * 查询投票
     *
     * @param id 投票ID
     * @return 投票
     */
    @Override
    public VoteInfo selectVoteInfoById(String id)
    {
        return voteInfoMapper.selectVoteInfoById(id);
    }

    /**
     * 查询投票列表
     *
     * @param voteInfo 投票
     * @return 投票
     */
    @Override
    public List<VoteInfo> selectVoteInfoList(VoteInfo voteInfo)
    {
        return voteInfoMapper.selectVoteInfoList(voteInfo);
    }

    /**
     * 新增投票
     *
     * @param voteInfo 投票
     * @return 结果
     */
    @Override
    public int insertVoteInfo(VoteInfo voteInfo)
    {
        voteInfo.setCreateTime(DateUtils.getNowDate());
        return voteInfoMapper.insertVoteInfo(voteInfo);
    }

    /**
     * 修改投票
     *
     * @param voteInfo 投票
     * @return 结果
     */
    @Override
    public int updateVoteInfo(VoteInfo voteInfo)
    {
        return voteInfoMapper.updateVoteInfo(voteInfo);
    }

    /**
     * 批量删除投票
     *
     * @param ids 需要删除的投票ID
     * @return 结果
     */
    @Override
    public int deleteVoteInfoByIds(String[] ids)
    {
        return voteInfoMapper.deleteVoteInfoByIds(ids);
    }

    /**
     * 删除投票信息
     *
     * @param id 投票ID
     * @return 结果
     */
    @Override
    public int deleteVoteInfoById(String id)
    {
        return voteInfoMapper.deleteVoteInfoById(id);
    }
}
